package cn.reflect;

/**
 * @author: lizemin
 * @version: 1.0
 */
public class Demo {
    //这是一个main方法,是程序的入口
    public static void main(String[] args) throws IllegalAccessException, InstantiationException {
        Class<Student> studentClass = Student.class;
        String simpleName = studentClass.getSimpleName();
        String name = studentClass.getName();
        System.out.println(name);
        System.out.println(simpleName);

//        Student student = studentClass.newInstance();
        //报错
        //Class cn.reflect.Demo can not access a member of class cn.reflect.Student with modifiers "private"
        //反射并未破坏封装性
//        System.out.println(student);

    }

}
